package com.winsafe.basescan;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.winsafe.scanlibrary.base.BaseScanAppCompatActivity;

public class MainActivity extends BaseScanAppCompatActivity {

    private static final String TAG = "MainActivity";
    private TextView tv_result;
    private StringBuilder resultStr;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv_result = findViewById(R.id.tv_result);
        resultStr = new StringBuilder();
    }

    @Override
    protected void onScanResult(String idCode) {
        Log.e(TAG, "onScanResult = " + idCode);
        resultStr.append(idCode).append("\n");
        tv_result.setText(resultStr);
    }

    public void goFragmentAct(View view) {
        startActivity(new Intent(MainActivity.this, FragmentScanActivity.class));
    }
}